import requests,re
import execjs
def make():
    with open('js_百度翻译1.js',"r")as f:
        js = f.read()
        return execjs.compile(js)

def sign(data):
    res = requests.get('https://fanyi.baidu.com/?aldtype=16047#auto/zh')

    gtk = re.findall('window.gtk = "(.*?)";', res.text)[0]

    sign = make().call('hhh', data, gtk)
    return sign